#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int n = 0;
    scanf("%d", &n);
    int last = 0;
    last = 2 + (n - 1) * 3;
    int sum = 0;
    sum = (2 + last) * n / 2;
    printf("%d", sum);
    return 0;
}